<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#parent {
				height: 200px;
				width: 200px;
				border: 1px solid red;

				display: flex;
				/* 父元素转换为弹性盒 */
				display: -webkit-flex;
				/* Safari */
				justify-content: center;
				/* 水平 */
				align-items: center;
				/* 垂直 */
			}

			#child {
				height: 50px;
				width: 50px;
				background-color: blue;
			}
		</style>
	</head>
	<body>
		<div id="parent">
			<div id="child"></div>
		</div>
	</body>
</html>
